<template>
  <div id="app">
     <!-- <app-sidebar></app-sidebar> -->
    <div class="container">
      <div class="row">
        <div class="col-md-12 col-ms-12 bg-light">
  <app-header></app-header>
   <!-- <app-header1></app-header1> -->
  
   
        </div>
      </div>
    </div>
    
   <div class="container">
           <!-- <app-tags></app-tags> -->
       <transition name="move" mode="out-in">
                    <keep-alive :include="tagsList">
                        <router-view></router-view>
                    </keep-alive>
                </transition>


   </div>

    <div class="container">
      <div class="row">
        <div class="col-ms-12 col-md-4"><router-view name="orderingGuide"></router-view></div>
        <div class="col-ms-12 col-md-4"><router-view name="delivery"></router-view></div>
        <div class="col-ms-12 col-md-4"><router-view name="history"></router-view></div>
      </div>

    </div>
  </div>
</template>

<script>
import Header from "./components/Header";
import Header1 from "./components/Header1";
import Sidebar from "./components/Sidebar.vue";
import Tags from "./components/Tags.vue";
import bus from "./vuex/bus";
export default {
  name: "App",
  data() {
    return {
      tagsList: []
    };
  },
  components: {
    "app-header": Header,
    "app-header1": Header1,
    "app-sidebar": Sidebar,
    "app-tags": Tags
  },

  beforeMount() {
    // alert(111);
    console.log(Header);
  },
  created() {
      console.log(this.$route);
    /*  fetch('/api/Home/GetItem',{
       method:'post',
       headers:{ "Content-type":"application/json"},
      
       body:JSON.stringify({Id:'111',name:"123"})
     }).then(response =>{
        console.log(111);
        console.log(response);
        return response.json();
        })
        .then(data => {
          // data就是我们请求的repos
          console.log(data);
          this.users=data;
        });*/
    bus.$on("tags", msg => {
      let arr = [];
      for (let i = 0, len = msg.length; i < len; i++) {
        msg[i].name && arr.push(msg[i].name);
      }
      this.tagsList = arr;
    });
  }
};
</script>

<style>
</style>
